async function request(body: string, url: string, token?: string) {
  let res = await fetch(url, {
    method: 'POST',
    body,
    headers: {
      'content-type': 'application/json',
      'Access-Control-Allow-Origin': "*",
      'mode': 'no-cors',
      'cookie': 'token=' + token
    },
  })
  let json = await res.json()
  return json
}

export function post(body: string, url: string, token?: string) {
  return request(body, url, token)
}